﻿using Microsoft.AspNetCore.Mvc;
using MS.Core.Model;
using ReportDesignerServer.DataModel;
using ReportDesignerServer.Services;

namespace ReportDesignerServer.Controllers
{

    /// <summary>
    /// 患者在科操作
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PatientInHospitalController : ControllerBase
    {
        PatientInHospitalService Service;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="patientInHospitalService"></param>
        public PatientInHospitalController(PatientInHospitalService patientInHospitalService)
        {
            this.Service = patientInHospitalService;
        }


        /// <summary>
        /// 查询到当天没有出院的人
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public Rt QueryPatientInHospital()
        {
            return Service.QueryPatientInHospital();
        }


        /// <summary>
        /// 通过id获取数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public Rt GetPatientInHospitalById(string id)
        {
            return Service.GetPatientInHospitalById(id);
        }


        /// <summary>
        /// 通过月份组查询数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public Rt SavePatientInHospital([FromBody] PatientInHospital model)
        {
            return Service.SavePatientInHospital(model);
        }
    }
}
